import { _decorator } from 'cc';
import { Suan24Dian_GameStorage } from "./Suan24Dian_GameStorage";

export class Suan24Dian_GameData {
    //    // static W: number = S2048_GameData.size * S2048_GameData.col;
    //    // static H: number = S2048_GameData.size * S2048_GameData.row;
    static W: number = 600;
    static H: number = 600;
    static row: number = 4; // 行数
    static col: number = 4; // 列数
    static size: number = Suan24Dian_GameData.W / Suan24Dian_GameData.row; // 方块的尺寸
    //    // public static CurrentLevel: number = 0;
    //    // static arrGrids: any[][] = [];
    static arrGrids = [];
    static arrBlocks = [];
    static Game_mode = `mode_3x3`;
    static Score: number = 0;
    static add_tip_number: number = 24;
    static IsMouseDown: boolean = false;
    static 本次滑动是否有合并: boolean = false;
    static colors = [
        { id: 2, color: "#FFF3E7", Label_color: "#424952" },
        { id: 4, color: "#FFEBCE", Label_color: "#424952" },
        { id: 8, color: "#FFC773", Label_color: "#424952" },
        { id: 16, color: "#FFA663", Label_color: "#FFFFFF" },
        { id: 32, color: "#FF8652", Label_color: "#FFFFFF" },
        { id: 64, color: "#FF5D52", Label_color: "#FFFFFF" },
        { id: 128, color: "#C6CB7B", Label_color: "#FFFFFF" },
        { id: 256, color: "#94CF94", Label_color: "#313031" },
        { id: 512, color: "#5ACFAD", Label_color: "#313031" },
        //        // 修改后的部分（每个颜色使用下一级的颜色值）
        { id: 1024, color: "#52B6CF", Label_color: "#313031" },  // ← 原2048的浅蓝
        { id: 2048, color: "#528BCF", Label_color: "#FFFFFF" },   // ← 原4096的中蓝
        { id: 4096, color: "#7B7BCB", Label_color: "#FFFFFF" },   // ← 原8192的紫蓝
        { id: 8192, color: "#9D5ACF", Label_color: "#FFFFFF" },   // ← 原16384的紫
        { id: 16384, color: "#CF5AA7", Label_color: "#FFFFFF" }    // 新生成的紫红色
    ];
    static level_data_list = {} //[];
    static isSlide: boolean = true;
    static direction;
    static gameState;
    static move_duration = 0.2;
    //    // 24点调关卡
    static Get_CurrentLevelIndex() {
        //        // return 2
        return Suan24Dian_GameStorage.data.current_level;
    }
    //    // 24点设置关卡
    static Set_CurrentLevelIndex(_value) {
        Suan24Dian_GameStorage.data.current_level = _value;
        Suan24Dian_GameStorage.saveData();
    }
    static GetLevelDataList() {
        return Suan24Dian_GameData.level_data_list;
    }
    static Get_numbers() {
        let level_data = Suan24Dian_GameData.Get_CurrentLevelData();
        let numbers = [level_data.a, level_data.b, level_data.c, level_data.d]
        // if (level_data) {
        return numbers;
        // }

        // return Suan24Dian_GameData.level_data_list;
    }
    static Get_CurrentLevelData() {
        let level_data = Suan24Dian_GameData.GetLevelDataList();
        if (level_data) {
            return level_data[Suan24Dian_GameData.Get_CurrentLevelIndex() - 1];
        }
    }
    static InitData() {

    }
    static ClearData() {

    }
    static GetScore() {
    }
    static SetScore(_score) {

    }
    static Add_score(_score) {

    }
    static Update_score(_score) {

    }
}

window["Suan24Dian_GameData"] = Suan24Dian_GameData;